// 引入 request 文件
import request from './index.js'

//创建房间
export const createHouseRequest = (param) => {
	return request({
		url: '/house/create',
		method: 'post',
		data:param
	})
}


//关闭房间
export const closeHouseRequest = (param) => {
	return request({
		url: '/house/close',
		method: 'post',
		data:param
	})
}



//获取房间二维码
export const getHouseQrCodeRequest = (param) => {
	return request({
		url: '/house/getqrcode',
		method: 'post',
		data:param
	})
}


//获取房间信息
export const getHouseInfoRequest = (param) => {
	return request({
		url: '/house/info',
		method: 'post',
		data:param
	})
}


//获取房间记录信息
export const getHouseRecordRequest = (param) => {
	return request({
		url: '/house/record/page',
		method: 'post',
		data:param
	})
}


//获取正在进行最近的一个房间信息
export const getCurrentHouseInfoRequest = (param) => {
	return request({
		url: '/house/current/info',
		method: 'post',
		data:param
	})
}

//积分转账  登录用户将积分转给B
export const transferAddScoreRequest = (houseCode,score,transferUserCode) => {
	var param={
		score:score,
		transferType:0,
		toTransferUserCode:transferUserCode,
		houseCode:houseCode
	}
	return request({
		url: '/house/score/transfer',
		method: 'post',
		data:param
	})
}

//积分转账  将B的积分转给登录用户
export const transferReduceScoreRequest = (houseCode,score,transferUserCode) => {
	var param={
		score:score,
		transferType:1,
		toTransferUserCode:transferUserCode,
		houseCode:houseCode
	}
	return request({
		url: '/house/score/transfer',
		method: 'post',
		data:param
	})
}


//加入房间
export const joinHouseRequest= (param) => {
	return request({
		url: '/house/join',
		method: 'post',
		data:param
	})
}

//保存房间用户信息
export const saveHouseUserInfoRequest = (param) => {
	return request({
		url: '/house/user/edit',
		method: 'post',
		data:param
	})
}


//获取房间用户信息
export const getHouseUserInfoRequest = (param) => {
	return request({
		url: '/house/user/info',
		method: 'post',
		data:param
	})
}



//获取房间记录页面
export const getHouseRecordPageRequest = (param) => {
	return request({
		url: '/house/record/page',
		method: 'post',
		data:param
	})
}


//获取房间通知分页信息
export const getHouseNoticePageRequest = (param) => {
	return request({
		url: '/house/notice/page',
		method: 'post',
		data:param
	})
}


//获取房间分数记录信息
export const getHouseScoreRecordInfoPageRequest = (param) => {
	return request({
		url: '/house/scorerecord/page',
		method: 'post',
		data:param
	})
}